#include <bits/stdc++.h>

using namespace std;

struct Array
{
	int val;
	int id;
}a[10005], b[10005];

int n, Q;
int opt, x, v;

bool cmp(Array x, Array y)
{
	if(x.val == y.val) return x.id < y.id;
	else return x.val < y.val;
}

int main()
{
	freopen("sort.in", "r", stdin);
	freopen("sort.out", "w", stdout);
	scanf("%d %d", &n, &Q);
	for(int i = 1;i <= n;i++)
	{
		scanf("%d", &a[i].val);	
		a[i].id = i;
		b[i].val = a[i].val;
		b[i].id = i;
	}	
	sort(b + 1, b + n + 1, cmp);
	while(Q--)
	{
		scanf("%d", &opt);
		if(opt == 1)
		{
			scanf("%d %d", &x, &v);
			a[x].val = v;
			for(int i = 1;i <= n;i++)
			{
				if(x == b[i].id)
				{
					b[i].val = v;
					break;
				}	
			}
			sort(b + 1, b + n + 1, cmp);
		}
		else
		{
			scanf("%d", &x);
			for(int i = 1;i <= n;i++)
			{
				if(x == b[i].id)
				{
					printf("%d\n", i);
					break;
				}
			}
		}
	}
	return 0;
}
